using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace HadronData
{
    /// <summary>
    /// This class will be instantiated by the XNA Framework Content
    /// Pipeline to read the specified data type from binary .xnb format.
    /// 
    /// Unlike the other Content Pipeline support classes, this should
    /// be a part of your main game project, and not the Content Pipeline
    /// Extension Library project.
    /// </summary>
    public class WorldContentTypeReader : ContentTypeReader<World>
    {
        protected override World Read(ContentReader p_contentReader, World p_world)
        {
            p_world = new World();
            p_world.Name = p_contentReader.ReadString();
            p_world.Levels = p_contentReader.ReadObject<List<Level>>();
            return p_world;
        }
    }
}
